import Inject from "@entity-access/entity-access/dist/di/di.js"; import Content from "@entity-access/server-pages/dist/Content.js"; import HtmlDocument from "@entity-access/server-pages/dist/html/HtmlDocument.js"; import XNode from "@entity-access/server-pages/dist/html/XNode.js"; import Page from "@entity-access/server-pages/dist/Page.js"; import EncryptionService from "../../../../../server/services/encryption/EncryptionService.js"; import { Route } from "@entity-access/server-pages/dist/core/Route.js"; import SocialMailContext from "../../../../../server/model/SocialMailContext.js"; export default class extends Page { @Inject es: EncryptionService; @Route eAttemptID: string; @Inject db: SocialMailContext; async run() { const attemptID = this.es.general.decrypt(this.eAttemptID) as any; const result = this.query.result; if (result) { switch (result) { case "success": await this.db.storePaymentAttempts .withKeys({ attemptID }) .update({ status: "paid" }); break; default: await this.db.storePaymentAttempts .withKeys({ attemptID }) .update({ status: "failed" }); break; } return this.redirect("/store/checkout-callback/" + attemptID); } return Content.html( Mock Payment Gateway

); } }